<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <title>Document</title>
  <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
  <meta name="description" content="Description">
  <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0">
  <!-- <link rel="stylesheet" href="assets/vue.min.css"> -->
  <link rel="shortcut icon" href="assets/favicon.ico">
  <link rel="stylesheet" href="//cdn.jsdelivr.net/npm/mermaid/dist/mermaid.min.css">
  <link rel="stylesheet" media="(prefers-color-scheme: dark)"
    href="//cdn.jsdelivr.net/npm/docsify-themeable@0/dist/css/theme-simple-dark.css">
  <link rel="stylesheet" media="(prefers-color-scheme: light)"
    href="//cdn.jsdelivr.net/npm/docsify-themeable@0/dist/css/theme-simple.css">

  <style>
    :root {
      --cover-max-width: 60em;
      color-scheme: light dark;
    }

    .app-nav ul>li>ul>li>ul {
      display: none
    }

    .app-nav a {
      color: var(--sidebar-nav-link-color);
    }

    .app-nav {
      top: calc(20px - .5em*var(--base-line-height));
    }
  </style>

</head>

<body>
  <div id="app">加载中...</div>
  <footer id="mb-footer"></footer>

  <script>
    var num = 0;
    var path = "docs"
    window.$docsify = {
      name: 'AIT',
      repo: 'https://gitee.com/ascend/ait',
      mergeNavbar: false,
      topMargin: 90,
      loadSidebar: 'menu.md',
      autoHeader: true,
      relativePath: true,
      loadNavbar: 'menu.md',
      coverpage: "start-page.md",
      alias: {
        '/.*/menu.md': '/menu.md', // See #301
      },

      // // 多个封面页，并指定文件名
      coverpage: {
        '/docs/': 'start-page.md',
        '/': 'start-page.md',
      },
      skipLink: false,
      onlyCover: true,
      subMaxLevel: 2,
      loadNavbarOnCover: true,
      search: 'auto', // 默认值
      markdown: {
        renderer: {
          code: function (code, lang) {
            if (lang === "mermaid") {
              return (
                '<div class="mermaid">' + mermaid.render('mermaid-svg-' + num++, code) + "</div>"
              );
            }
            return this.origin.code.apply(this, arguments);
          },
          link: function (href, title, text) {
            const menuPageFlag = "**menu**";
            const menuPathFlag = "/ait";
            if (href && href.startsWith(menuPathFlag) && title && title.includes(menuPageFlag)) {
              return this.origin.link.apply(this, [href.substring(menuPathFlag.length), title.replace(menuPageFlag, ""), text])
            }
            return this.origin.link.apply(this, arguments)
          }
        }
      },
      plugins: [
        function (hook, vm) {
          // hook.beforeEach(async function (content, callback) {
          //   let regex = /\[INCLUDE\]\(([\w\.\\\/\-]+.md)\)/g;
          //   let urls = new Set()

          //   while ((regRes = regex.exec(content)) !== null) {
          //     urls.add(regRes[1])
          //   }

          //   let newContent = content;

          //   for (const mdUrl of urls) {
          //     let mdContent = await window.Docsify.get(mdUrl)
          //     newContent = content.replace(`[INCLUDE](${mdUrl})`, mdContent);
          //   }

          //   callback(newContent);
          // });
        }]
    }
  </script>
  <!-- Docsify v4 -->
  <script src="assets/docsify.js"></script>
  <script src="assets/plugins/search.min.js"></script>
  <script defer src="//cdn.jsdelivr.net/npm/docsify-copy-code/dist/docsify-copy-code.min.js"></script>

  <!-- <script src="https://cdn.jsdelivr.net/npm/docsify-themeable@0/dist/js/docsify-themeable.min.js"></script> -->
  <script defer src="assets/plugins/zoom-image.min.js"></script>


  <script defer src="//cdn.jsdelivr.net/npm/mermaid/dist/mermaid.min.js"></script>

  <script defer src="//cdn.jsdelivr.net/npm/prismjs@1/components/prism-python.min.js"></script>
  <script defer src="//cdn.jsdelivr.net/npm/prismjs@1/components/prism-bash.min.js"></script>
  <script defer src="//cdn.jsdelivr.net/npm/prismjs@1/components/prism-c.min.js"></script>
  <script defer src="//cdn.jsdelivr.net/npm/prismjs@1/components/prism-rust.min.js"></script>

</body>

</html>